home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / dhtmlunl / dhtml.exe / CD Content / Chap28 / dun28_6.txt < prev   
Encoding:
Text File  |  1997-12-18  |  615 b   |  22 lines

  1. function audioEnabled(plug_in) {
  2.     for (var i = 0; i < navigator.plugins.length; i++) {
  3.         if (navigator.plugins[i].name.toLowerCase() == plug_in.toLowerCase()) {
  4.             for (var j = 0; j < navigator.plugins[i].length; j++) {
  5.                 if (navigator.plugins[i][j].enabledPlugin) {
  6.                     return true
  7.                 }
  8.             }
  9.             return false
  10.         }
  11.     }
  12.     return false
  13. }
  14.  
  15. function playAudio(cmd) {
  16.     if (audioEnabled("LiveAudio")) {
  17.         if (cmd == "2001") {
  18.             document.MIDI.play(false);
  19.         }
  20.     }
  21. }
  22.